package com.ld.project.zkn.service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ld.project.zkn.dao.UserDao;
import com.ld.project.zkn.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    public User getUserById(Integer id){
       return   userDao.getUserByid(id);
    }

    public Page<User> pageUser(int pageNumber, int pageSize){
       return   PageHelper.startPage(pageNumber,pageSize).doSelectPage(()-> userDao.pageUser());
    }
}
